{% extends 'front/index_products/base_index_products.html' %}

{% block main %}
    <!--页面banner-->
    <div id="banner">
        <!-- <div class="container"></div> -->
        <div class="swiper-container">
            <div class="swiper-wrapper">
                {% for image in banner_images %}
                <div class="swiper-slide"><img src="{{ url_for('static', filename='images/banner/'+image) }}" width="100%;"
                                               height="630"></div>
                {% endfor %}
            </div>
            <!-- Add Pagination -->
            <div class="swiper-pagination"></div>
            <div class="swiper-button-next"></div>
            <div class="swiper-button-prev"></div>
        </div>
        <div class="banner-nav-bg"></div>
    </div>
    <!--图书部分-->
    <div id="book">
        <div class="container">
            <div class="book_top">
                <img src="{{ url_for('static',filename='images/readerrecommend.png') }}/">
            </div>
            <div class="book_list">
                <ul>
                    {% for book in books %}
                        <li>
                            <a href="{{ url_for('products.product', id=book['_id']) }}" title={{ book.title }}>
                                <img src="{{ book['img_url'] }}" alt="{{ book.title }}">
                            </a>
                            <p><a href="{{ url_for('products.product', id=book['_id']) }}"
                                  title={{ book.title }} class="name">{{ book.title }}</a></p>
                            <p class="author">{{ book.author }}</p>
                            <p class="price">
        <span class="rob">
            <span class="sign">&yen;</span>
            <span class="num">{{ book.price }}</span>
        </span>
                                <span class="price_r">
            <span class="sign">&yen;</span>
            <span class="num">{{ book.price_m }}</span>
        </span>
                            </p>
                        </li>
                    {% endfor %}
                </ul>
            </div>
        </div>
    </div>
    <!--搜索部分设计-->
    <div id="book_new">
        <div class="container">
            <div class="book_new_top">
                <img src="{{ url_for('static',filename='images/newbook.jpg') }}"/>
            </div>
            <div class="new_book_main">
                <div class="new_book_left left">
                    <ul>
        {% for new_book in new_books %}
            <li>
                <a href="{{ url_for('products.product', id=new_book['_id']) }}" title={{ new_book.title }} class="name">
                    <img src={{ new_book['img_url'] }}>
                </a>
                <p><a href="{{ url_for('products.product', id=new_book['_id']) }}"
                      title={{ new_book.title }} class="name">{{ new_book.title }}</a></p>
                <p class="price">
            <span class="rob">
                <span class="sign">&yen;</span>
                <span class="num">{{ new_book.price }}</span>
            </span>
                    <span class="price_r">
                <span class="sign">&yen;</span>
                <span class="num">{{ new_book.price_m }}</span>
            </span>
                </p>
            </li>
        {% endfor %}
    </ul>
                </div>
                <div class="new_book_right right tab">
                    <!--选项卡-->
                    <!--选项的头部-->
                    <div id="tab-header" class="new_book_title">
                        <ul>
                            <li class="selected">
                                <div class="new_book_list">新书榜</div>
                            </li>
                            <li>
                                <div class="new_book_best">畅销榜</div>
                            </li>
                            <!--<li>技术</li>-->
                        </ul>
                    </div>
                    <!--主要内容-->
                    <div id="tab-content">
                        <div class="dom" style="display: block;">
                            <ul>
        {% for top in book_top %}
            <li>
                <dl>
                    <dt>
                        <a href="{{ url_for('products.product', id=top['_id']) }}" title="{{ top['title'] }}"><img
                                src="{{ top['img_url'] }}" alt="{{ top['title'] }}"></a>
                    </dt>
                    <dd><p><a href="{{ url_for('products.product', id=top['_id']) }}">{{ top.subheading }}</a></p></dd>
                </dl>
            </li>
        {% endfor %}
    </ul>
                        </div>
                        <div class="dom" style="display: block;">
                            <ul>
        {% for top in book_top2 %}
            <li>
                <dl>
                    <dt>
                        <a href="{{ url_for('products.product', id=top['_id']) }}" title="{{ top['title'] }}"><img
                                src="{{ top['img_url'] }}" alt="{{ top['title'] }}"></a>
                    </dt>
                    <dd><a href="{{ url_for('products.product', id=top['_id']) }}">{{ top.subheading }}</a></dd>
                </dl>
            </li>
        {% endfor %}
    </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block footer %}
    {{ super() }}
{#返回顶部控件#}
<div id="to_top">
    <a href="javascript:;" id="to_top_btn"></a>
</div>
{#隐藏登录控件#}
<div>
    <div class="mypop" style="display: none">
        <div class="graybox"></div>
        <div class="popbox">
            <div class="poptop">
                <h3>登 录</h3>
                <a href="#" class="close"></a>
            </div>
            {#            <form role="form" method="post" action="{{ url_for('user_login_register.index_login') }}">#}
            {#            错误信息flash #}
            <span id="message"></span>
            <div class="popcon">
                <div>
                    <div class="group">
                        {#                    失去焦点：onBlur="if(value==''){value='请输入密码'}"获取焦点：onFocus="if(value=='请输入密码') {value=''}"#}
                        <input type="tel" placeholder="请输入您的手机号码" name="username" pattern="[0-9]{11}"
                               id="login_username"
                                {#                               onkeyup="this.value=this.value.replace(/^\s+|\s+$/g,'')"#}
                               required autofocus maxlength="11" minlength="11">
                        <i class="fa fa-user"></i>
                    </div>
                    <div class="group">
                        <input type="password" name="password" required placeholder="请输入您的密码" id="login_password">
                        <i class="fa fa-lock"></i>
                    </div>
                </div>
                <div class="remember clearfix">
{#                    <div class="remember-con">#}
{#                        <input type="checkbox" id="input1" class="inputbox">#}
{#                        <label for="input1">记住密码</label>#}
{##}
{#                    </div>#}
                    <div class="remember-con">
                        <a href="{{ url_for('building.building') }}" class="code"><i class="fa fa-question-circle"></i>忘记密码</a>
                        <a href="{{ url_for('user_login_register.register') }}"><i class="fa fa-question-circle"></i>去注册</a>&nbsp;
                        <a href="mailto:caisi1735@163.com"><i class="fa fa-question-circle"></i>Email to Admin</a>

                    </div>
                </div>
            </div>
            <div class="divbtn clearfix">
                <a class="btn" id="cancel" href="#">取消</a>
                {#                <a href="{{ url_for('building.building') }}" class="btn ok" onclick="index_login()">登陆</a>#}
                <button type="submit" class="btn ok" id="index_login">登陆</button>
            </div>
            {#            </form>#}
        </div>
    </div>
</div>
{% endblock %}
